<template>
  <div class="modal" v-if="is_open">
    <div class="content">
      <p class="title">{{ title }}</p>
      <i class="el-icon-close close" @click="hide()"></i>
      <div>{{ content }}</div>
    </div>
  </div>
</template>
<script>
export default {
  props: ["title", "content"],
  data() {
    return {
      is_open: true,
    };
  },
  methods: {
    show() {
      this.is_open = true;
    },
    hide() {
      this.is_open = false;
    },
  },
};
</script>
<style>
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  background-color: rgba(0, 0, 0, 0.3);
}
.content {
  width: 200px;
  height: 200px;
  background-color: #fff;
  margin: 0px auto;
  margin-top: 200px;
  text-align: center;
  font-size: 14px;
  color: #333;
  padding: 5px;
}
.title {
  margin-bottom: 20px;
  font-size: 16px;
}
.close {
  text-align: right;
}
</style>
